# coding=utf-8
# 作者： 磊
# @Time：2022/5/5
import json
import random
import pytest
from Demo07.common.request_util import RequestsUtil
from Demo07.common.yaml_util import write_extract_yaml, read_extract_yaml, read_testcase_yaml

'''
1、主要是yml的封装，读取yml用例
2、去除RequestsUtil()中的基础路径和url
3、约定请求规范
'''

class TestSecondRequest7:
    @pytest.mark.parametrize('caseinfo', read_testcase_yaml('/Demo07/testcase/yaml/get_token.yml'))
    def test_get_toke(self,caseinfo):
        res=RequestsUtil().analysis_yaml(caseinfo)

    @pytest.mark.parametrize('caseinfo', read_testcase_yaml('/Demo07/testcase/yaml/query_token.yml'))
    def test_query_token(self,caseinfo):
        res=RequestsUtil().analysis_yaml(caseinfo)

    @pytest.mark.parametrize('caseinfo', read_testcase_yaml('/Demo07/testcase/yaml/post_edit_id.yml'))
    def test_post_edit(self,caseinfo):
        res=RequestsUtil().analysis_yaml(caseinfo)

    @pytest.mark.parametrize('caseinfo', read_testcase_yaml('/Demo07/testcase/yaml/file_up.yml'))
    def test_file_up(self,caseinfo):
        res=RequestsUtil().analysis_yaml(caseinfo)

if __name__ == '__main__':
        pytest.main(['-vs',"test10.py"])

